import {defineStore} from 'pinia'


const state = ()=>( {
	userInfo: {}
})

const getters = {
	getUserInfo() {//获取用户信息
		return this.userInfo
	}
}

const actions = {
	setUserInfo(userInfo) { // 设置用户信息
		this.userInfo = userInfo
	}
}

export const userStore = defineStore({
	id: 'user-store',
	state,
	getters,
	actions,
	persist: { //  持久化插件
	    enabled: true, // 使用存储     
	}

})


